Skip to content

FIX: Input Actions editor window throws a "Failed to load asset" exception on startup when its layout is restored in a different project [UUM-144318] - #2465

Merged
Pauliusd01 merged 3 commits into
developfrom
fix/uum-144318-inputactionseditorwindow-restore
Aug 5, 2026
Merged

FIX: Input Actions editor window throws a "Failed to load asset" exception on startup when its layout is restored in a different project [UUM-144318]#2465
Pauliusd01 merged 3 commits into
developfrom
fix/uum-144318-inputactionseditorwindow-restore

Conversation

@Pauliusd01

@Pauliusd01 Pauliusd01 commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Description

Note

This pull request was generated automatically. Please review carefully before merging.

InputActionsEditorWindow.CreateGUI() persists its target asset's GUID (m_AssetGUID) in the editor window layout, which is shared across projects. When the window's layout is restored in a project where that GUID resolves to no asset, the restore branch loads a null asset and throws, and the surrounding catch surfaces it via Debug.LogException on editor startup.

The asset == null branch now closes the window quietly instead of throwing. The close is scheduled through EditorApplication.delayCall rather than called inline: CreateGUI() runs inside the UIToolkit repaint, and closing the window synchronously there tears down its panel mid-repaint, which then produces a follow-up NullReferenceException in the render tree. Deferring the close lets CreateGUI() return cleanly and the window closes on the next editor tick.

Testing status & QA

  • No automated test added - the branch only runs on an editor domain-reload window-layout restore where the persisted asset GUID does not resolve in the current project, which InputTestFixture / edit-mode tests cannot reproduce.
  • QA can re-run the manual repro from https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-144318 and confirm no exception is logged on startup.

Overall Product Risks

  • Complexity: low
  • Halo Effect: low (internal-only edit confined to one branch of a private method; no public API surface touched)
  • Risk rating: 3/5 - The changed asset==null branch runs only on a real domain-reload/cross-project restore, which the edit-mode tests never reproduce, so the specific behaviour is untested and a regression could land uncaught despite the delta being confined to suppressing one log.

Comments to reviewers

The window shows an empty panel for a single editor tick before delayCall closes it; this is expected given the close is deferred out of the repaint. The sibling catch block a few lines below still calls Close() synchronously for genuinely unexpected restore exceptions and has the same latent teardown risk, but it was left unchanged to keep this fix scoped to the reported scenario.

Note: if fixing it this way is undesirable then maybe changing the type of the message from error to a warning would be enough?

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

…ption on startup when its layout is restored in a different project [UUM-144318]

The Input Actions editor window persisted its target asset's GUID in the editor window layout, which is shared across projects, so a restore in a project where that GUID resolved to no asset logged an exception on startup.

In InputActionsEditorWindow.CreateGUI(), the layout-restore branch loaded the asset from the persisted GUID and threw an Exception when the load returned null, which the surrounding catch surfaced via Debug.LogException before closing the window. The asset == null branch now closes the window quietly instead of throwing. The close is deferred via EditorApplication.delayCall because CreateGUI runs inside the UITK repaint; closing synchronously there tears down the window's panel mid-repaint and produces a follow-up NullReferenceException. No working copy exists to clean up at that point.

Jira: https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-144318
@Pauliusd01 Pauliusd01 self-assigned this Aug 5, 2026
@Pauliusd01
Pauliusd01 marked this pull request as ready for review August 5, 2026 10:12

@u-pr u-pr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Harness Review

Ship it

The stale-GUID restore path is handled before invalid asset data reaches the editor state or UI construction.

Reviewed commit 8e1d2f3

🤖 Helpful? 👍/👎

@codecov-github-com

codecov-github-com Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...Editor/UITKAssetEditor/InputActionsEditorWindow.cs 0.00% 3 Missing ⚠️
@@             Coverage Diff             @@
##           develop    #2465      +/-   ##
===========================================
- Coverage    78.95%   78.95%   -0.01%     
===========================================
  Files          767      767              
  Lines       140780   140807      +27     
===========================================
+ Hits        111153   111172      +19     
- Misses       29627    29635       +8     
Flag Coverage Δ
inputsystem_MacOS_6000.0 5.31% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.0_project 77.49% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.3 5.31% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.3_project 77.49% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.5 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.5_project 77.55% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.6 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.6_project 77.55% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.7 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.7_project 77.55% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.0 5.31% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.0_project 77.40% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.3 5.31% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.3_project 77.39% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.5 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.5_project 77.45% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.6 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.6_project 77.45% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.7 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.7_project 77.45% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...Editor/UITKAssetEditor/InputActionsEditorWindow.cs 52.62% <0.00%> (-0.24%) ⬇️

... and 1 file with indirect coverage changes

ℹ️ Need help interpreting these results?

@Pauliusd01
Pauliusd01 removed the request for review from ritamerkl August 5, 2026 10:40

@MorganHoarau MorganHoarau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Safe and simple. Comment is a bit verbose. Discussed on slack.

…utactionseditorwindow-restore

# Conflicts:
#	Packages/com.unity.inputsystem/CHANGELOG.md
@Pauliusd01
Pauliusd01 merged commit 8216408 into develop Aug 5, 2026
5 of 76 checks passed
@Pauliusd01
Pauliusd01 deleted the fix/uum-144318-inputactionseditorwindow-restore branch August 5, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants